<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.psl.model.userlogin" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    userlogin userinfo = (userlogin) session.getAttribute("user");
    if (userinfo == null) {
        response.sendRedirect("/login.do");
    }%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="/assets/css/text.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/main.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/content.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    </script>
    <style>
        #title {
            width: 92%;
            border: 0px;
            margin-bottom: 10px;
        }

        #title td {
            text-align: center;
            height: 20px;
            line-height: 150%
        }

        #title div {
            background-image: url(/assets/img/dot_02.gif);
            background-position: left top;
            background-repeat: no-repeat;
            margin: 0 auto;
            padding-left: 20px;
            text-align: left;
            width: 10%;
            font-size: 15px;
            font-weight: bold;
            color: #CC0000;
            letter-spacing: 2px;
        }

        tr.change:hover {
            background-color: #dd3c10;
        }
    </style>

</head>
<body>
<table cellspacing="0" cellpadding="0" id="title" align="center">
    <tbody>
    <tr>
        <td nowrap="nowrap">
            <div> 外协铸件暂收凭条</div>
        </td>
    </tr>
    </tbody>
</table>

<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" class="datalist">
    <tbody>
    <tr>
        <td align="center" >供货单位</td>
        <td height="25" align="center" >铸件/配件编码</td>
        <td height="25" align="center" >铸件/配件名称</td>
        <td align="center" >规格</td>
        <td align="center" >数量</td>
        <td align="center" >商标</td>
        <td align="center" >压力</td>
        <td align="center" >单重</td>
        <td align="center" >总重</td>
        <td align="center" >送货日期</td>
        <td align="center" >送货人员</td>
        <td align="center" >凭条编号</td>
        <td align="center" >操作</td>
    </tr>
    <c:forEach items="${product}" var="h">
    <form action="/halfproductUpdate.do" method="post">
        <input type="hidden" name="status" value="0">
        <input type="hidden" name="h_id" value="${h.h_id}">
        <tr>
            <td height="25" align="center" >
                <jsp:include page="supplier.jsp"/>
            </td>
            <td height="25" align="center" ><input id="h_no" name="h_no" type="text" value="${h.h_no}">
            </td>
            <td height="25" align="center" ><input id="h_name" name="h_name" type="text"
                                                                    value="${h.h_name}"></td>
            <td height="25" align="center" ><input id="h_size" name="h_size" type="text"
                                                                    value="${h.h_size}"></td>
            <td height="25" align="center" ><input name="h_num" id="h_num" type="number"
                                                                    value="${h.h_num}"></td>
            <td height="25" align="center" >
                <jsp:include page="R.jsp"/>
            </td>
            <td height="25" align="center" >
                <jsp:include page="PN.jsp"/>
            </td>
            <td height="25" align="center" ><input type="text" id="h_uw" name="h_uw"
                                                                    value="${h.h_uw}" size="20">
                <script>function cal() {
                    document.getElementById("sum").value = (parseInt(document.getElementById("h_uw").value) * parseInt(document.getElementById("h_num").value));
                }</script>
            </td>
            <td height="25" align="center" ><input type="number" id="sum" name="sum"
                                                                    value="${h.h_num * h.h_uw}"
                                                                    size="20" onclick="cal()"></td>
            <td height="25" align="center" ><input type="text" name="h_date"
                                                                    value="${h.h_date}"></td>
            <td height="25" align="center" ><input type="text" name="h_people"
                                                                    value="${h.h_people}"></td>
            <td height="25" align="center" ><input type="text" name="h_ticketno"
                                                   value="${h.h_ticketno}"></td>
            <td height="25" align="center" ><input type="submit" name="update" value="保存修改"></td>
        </tr>
    </form>
    </c:forEach>
    </tbody>
</table>
</body>
</html>